<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%
request.setCharacterEncoding("GB2312");
%>
<jsp:useBean id="post" scope="page" class="dsp.web.Subject"/>
<%
post.setBoardid(Integer.parseInt(request.getParameter("boardid")));
post.setTitle(request.getParameter("title"));
post.setMotion(request.getParameter("emotion"));
post.setBody(request.getParameter("content"));
post.setUsername(String.valueOf(session.getAttribute("username")));
post.setIp(request.getRemoteAddr());
post.setImage(request.getParameter("imgfile"));
post.addSubject();
if(post.isStatus()){
	response.setHeader("Pragma", "no-cache");
	response.setHeader("Expires", "0");
	response.sendRedirect("forum.jsp?boardid="+request.getParameter("boardid"));
}
else{
	out.println("<script language=javascript> alert('"+ post.getMsg() + "'); history.back();</script>");	
}
%>